﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MESMian.Migrations
{
    /// <inheritdoc />
    public partial class removerequired : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "Uints",
                type: "datetime",
                nullable: false,
                defaultValueSql: "GETDATE()",
                oldClrType: typeof(DateTime),
                oldType: "datetime");

            migrationBuilder.CreateTable(
                name: "StoreCategories",
                columns: table => new
                {
                    StoreCategoryId = table.Column<int>(type: "int", nullable: false, comment: "仓库类型主键，自动编号")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    StoreCategoryName = table.Column<string>(type: "varchar(30)", nullable: false, comment: "仓库类型名称，不能重复"),
                    Status = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
                    CreateUserId = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "GETDATE()"),
                    LastUpdateUserId = table.Column<int>(type: "int", nullable: true),
                    LastUpdateTime = table.Column<DateTime>(type: "datetime", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_StoreCategories", x => x.StoreCategoryId);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "StoreCategories");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "Uints",
                type: "datetime",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldType: "datetime",
                oldDefaultValueSql: "GETDATE()");
        }
    }
}
